<?php session_start() ?>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <link href="../css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<?php
	require('../public/conn.php');
	$agree = $_GET['agree'];
	$requester = $_GET['requester'];
	$receiver = $_GET['receiver'];
	if($agree == 1){//若同意好友申请，删除申请记录，添加好友记录
		mysql_query("DELETE FROM add_friends_applys WHERE apply_requester='$requester' AND apply_receiver='$receiver'");//删除
		mysql_query("INSERT INTO friends (friendA,friendB) VALUES ('$requester','$receiver')");//添加
	}else if($agree == 0){//若拒绝好友申请，则只删除申请记录
		mysql_query("DELETE FROM add_friends_applys WHERE apply_requester='$requester' AND apply_receiver='$receiver'");//删除
	}
	mysql_close($con);
?>
</body>
</html>